package command.facility;

/**
 * @author: zhouyang
 * @descrpition: 具体设备类 灯
 * @time: 2019-05-26 16:32
 */
public class Light {
    boolean status ;

    private String name;

    public Light(String name) {
        this.name = name;
        this.status = false;
    }

    public void LightOn(){
        if(!status) {
            System.out.println(this.name + " --- light on");
            status = true;
        }else{
            System.out.println(this.name + " --- light is on !");
        }
    }

    public void LightOff(){
        if(status) {
            System.out.println(this.name + " --- light off");
            this.status = false;
        }else{
            System.out.println(this.name + " --- light is off !");
        }
    }
}
